/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package POI;

/**
 *
 * @author Ahalya
 */

import com.auxilii.msgparser.*;

public class SimpleMsgParser {
  public static void main(String[] args) throws Exception{
    MsgParser msgp = new MsgParser();
    Message msg = msgp.parseMsg("c:/Aika/Load Email/Load Email/$ 8.25 on Tower City load today! (2.61 KB).msg");

    String fromEmail = msg.getFromEmail();
    String fromName = msg.getFromName();
    String subject = msg.getSubject();
    String body = msg.getBodyText();
    System.out.println("From :" + fromName + " <" + fromEmail + ">");
    System.out.println("Subject :" + subject);
    System.out.println("");
    System.out.println(" MAIL body"+body);
    System.out.println("");

  /*  List atts = msg.getAttachments();
    for (Attachment att : atts) {
      if (att instanceof FileAttachment) {
        FileAttachment file = (FileAttachment) att;
        System.out.println("Attachment : " + file.getFilename());
        // you get the actual attachment with
        // byte date[] = file.getData();
      }
    }*/
  }
}